#pragma once
#ifndef __STR_FUN__
#define __STR_FUN__

#include <iostream>
#include <string>
#include <vector>
#include "IUtility.h"

using namespace std;

class CStrFun: public virtual IStrFun
{
INIT_CLASS_SINGLETON( CStrFun )

public:
	const char * SeparateString( char * pszResult, int iSize, const char * pszStr, const char * pszSpeStr, const int iIdx ) const;
	const char * BeforSeparateString( const char * pszStr, const char * pszSpeStr, const int iIdx ) const;
	const int SeparateCount( const char * pszStr, const char * pszSpeStr ) const;
	const int StrCount( const char * pszStr, const char * pszSpeStr ) const;
	const int Pos( const char * pszStr, const char * pszSubStr ) const;
	const int Pos(const char * pszStr, const int iLen, const char * ptrFind, const int iFindLen);
	const bool IsEmpty( const char * pszStr ) const;
	const char * ParaVal( char * pszResult, int iSize, const char * pszCommandTxt, const char * pszParaName ) const;
	const char * KeyVal( char * pszValue, int iSize, const char * pszCommandTxt, const char * pszKeyName, const char * pszSpeStr = ";" ) const;
	const char * CaseUpper( const char *pszStr ) const;
	const char * Trim( char * pszResult, int iSize, const char * pszStr ) const;
	const bool IsNum(const char * pszStr ) const;  
	const bool GetIniFileSectionInfo( const char * pszIniFile, const char * pszSectionName, void * pvtSectionInfo );
    const bool MemCopy(void * ptrDes, void * ptrSou, int iDesLen, int iSouLen, bool AFullCpyFlg = false);
	const bool CurrToStr(string & strNum, string & strValue, int iDigits, int iCarryNum = 5);
	const bool CurrToStr(double dNum, string & strValue, int iDigits, int iCarryNum = 5);
	const bool CurrToStr(char * pszNum, char * pszValue, int iLen, int iDigits, int iCarryNum = 5);
	const bool CurrToStr(double dNum, char * pszValue, int iLen, int iDigits, int iCarryNum = 5);
	char * StrReplace(char * pszSouStr, char * pszDesStr, int iDesSize, const char * pszOld, const char * pszNew);
	string StrReplace(string & strStr, const char * pszOld, const char * pszNew);
};
#endif  //__STR_FUN__
